//
//  Service+Product.m
//  umibus
//
//  Created by fengyn on 16/6/22.
//  Copyright © 2016年 lexingsoft. All rights reserved.
//

#import "Service+Product.h"

@implementation ServiceManager(Product)
///手机端获取商品列表
+ (void)getProductsWithOperatorCode:(NSString *)operatorCode productType:(NSString *)productType packageCount:(NSString *)packageCount success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString *path = @"/product/list/phone";
    NSDictionary *parameterDict=@{@"operatorCode":operatorCode,
                                  @"productType":productType,
                                  @"lockStatus":@"N"};
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];
}

///查询发现基金商品列表
+ (void)getFundGoodsWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = @"/product/map";
    NSDictionary * parameterDict=nil;
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id dataObject) {
        failure(dataObject);
    }];
}

///理财流量回购
+ (void)userBackBuyWithOrderSn:(NSString *)orderSn success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = [NSString stringWithFormat:@"/fundProduct/orderSn/%@",orderSn];
    NSDictionary * parameterDict=nil;
    [NetworkClient postRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];
}

@end
